<?php

class Rapide_Dispatcher_Token implements Rapide_Dispatcher_Token_Interface
{
	private
		$_sController,
		$_sAction,
		$_aParameters;

	public function __construct($sController, $sAction, array $aParameters = array())
	{
		$this->_sController = $this->_tstring(strtolower($sController));
		$this->_sAction = $this->_tstring(strtolower($sAction));
		$this->_aParameters = $aParameters;
	}

	public function getController()
	{
		return $this->_sController;
	}

	public function getAction()
	{
		return $this->_sAction;
	}

	public function getParameters()
	{
		return $this->_aParameters;
	}
	
	private function _tstring($sString)
	{
		$sString = preg_replace('/^[^a-z_]/i', '', $sString);
		return preg_replace('/[^a-z0-9_]/i', '', $sString);
	}
}

?>